
<script type="text/javascript" src="http://www.google.com/jsapi?key=<{$googleApiCode}>"></script>
<script type="text/javascript">
  google.load("maps", "2.x");
   
  // Call this function when the page has been loaded
  function initialize() {
    var map = new google.maps.Map2(document.getElementById("dMap"));
    //map.setCenter(new google.maps.LatLng(10.8024,106.641), 13);
    var poin;
	<{foreach from=$listAddress item=add name='add'}>
		<{if $smarty.foreach.add.index == 0}>
		map.setCenter(new GLatLng(<{$add.lat}>,<{$add.lng}>), 13);
		<{/if}>
		poin =new GLatLng(<{$add.lat}>,<{$add.lng}>);
		map.addOverlay(new GMarker(poin));
	<{/foreach}>
  }
  google.setOnLoadCallback(initialize);
</script>
<div class="body-left" id="divBody_Left">
    <!--TN 11.10-->
    <div itemtype="http://data-vocabulary.org/Product" itemscope="" class="detail-deal detail-deal-trans" id="DealInfo">
        <div class="bg-detaildeal"></div>
        <h2 class="titledeal" itemprop="name">
            <strong style="color:#FF9900;font-weight:normal;font-size:21px"><{$grouponEntity->groupon_name}>:</strong>
            <p><{$grouponEntity->title}></p>
        </h2>
        <div class="<{if $dealsEntity->bought_count >= $dealsEntity->max_bought}>fireof
        <{elseif $isExpired}>expires
        <{else}>orderdeal<{/if}>
        ">
            <div itemtype="http://data-vocabulary.org/Offer" itemscope="" itemprop="offerDetails" class="box-white-info">
                <div class="detail-deal-info">
                    <p class="margin-negative" itemprop="price"><{$dealsEntity->sale_price|number_format}><strong itemprop="currency"> VNĐ</strong></p>
                    <p>	
                    	<{if $dealsEntity->bought_count >= $dealsEntity->max_bought}><span class="view-button"></span>
				        <{elseif $isExpired}><span class="view-button"></span>
				        <{else}>
				        	<a class="view-button" name="" href="<{$APPLICATION_URL}>/Browse/Deals/BuyDeal/city/<{$city}>/id/<{$dealsEntity->id}>"></a>
				        <{/if}>
                    	
                    </p>
                    <div class="box-white-info-price">
                        <p>Giá gốc: <span><{$dealsEntity->original_price|number_format}></span> VNĐ</p>
                    </div><div class="box-white-info-sale">
                        <div class="box-white-info-save">
                            <span class="number"><{$perDiscount}>%</span>
                            <span>tiết kiệm</span>
                        </div>
                        <div class="box-white-info-buyer">
                            <span class="number"><{$dealsEntity->bought_count}></span>
                            <span>người mua</span>
                        </div>
                        <div class="box-white-info-time">
                            <span id="Time_CountDown_1962" class="number">0:0:0</span>
                            <span>thời gian còn lại</span>
                        </div>
                        <div class="clear"></div>

                    </div>
                    <div class="progess-bar">
                    
                        <div class="bg-progess-bar">
                            <div class="inner-progess-bar">
                                <span style="width:<{if $dealsEntity->bought_count > $dealsEntity->max_bought}>100<{elseif $isExpired}>100<{elseif $dealsEntity->bought_count < $dealsEntity->min_bought}><{math equation = "bought_count/min_bought *100" bought_count=$dealsEntity->bought_count min_bought=$dealsEntity->min_bought}><{elseif $dealsEntity->bought_count >= $dealsEntity->min_bought}><{math equation = "bought_count/max_bought *100" bought_count=$dealsEntity->bought_count max_bought=$dealsEntity->max_bought}><{/if}>%" class="progess">
                                    <em class="progess-arrow"></em>
                                </span>
                            </div>
                        </div>
                     <{if $dealsEntity->bought_count >= $dealsEntity->max_bought}>
                      <em>Số lượng mua đã hết</em>
			         <{elseif $isExpired}><em>Sản phẩm đã hết hạn</em>			         
                     <{elseif $dealsEntity->bought_count < $dealsEntity->min_bought}>
                        <em>cần <i><{$dealsEntity->min_bought}></i> người để được giá tốt</em>
                     <{elseif $dealsEntity->bought_count >= $dealsEntity->min_bought}>
                        <em>còn <i><{$dealsEntity->max_bought-$dealsEntity->bought_count}></i> cơ hội</em>
                     <{/if}>
                    </div>
                </div>
                <!--<div style="overflow:visible;padding-left:5px;" id="divLinkSharing" class="fullview-links">
                    <div style="float:left;width:70px;margin-left:7px;" class="googleplus"><div id="___plusone_0" style="height: 20px; width: 90px; display: inline-block; text-indent: 0pt; margin: 0pt; padding: 0pt; background: none repeat scroll 0% 0% transparent; border-style: none; float: none; line-height: normal; font-size: 1px; vertical-align: baseline;">
                            <iframe width="100%" scrolling="no" frameborder="0" title="+1" vspace="0" tabindex="-1" style="position: static; left: 0pt; top: 0pt; width: 90px; margin: 0px; border-style: none; height: 20px; visibility: visible;" src="https://plusone.google.com/_/+1/fastbutton?url=http%3A%2F%2Fwww.nhommua.com%2Ftp-ho-chi-minh%2Fdeals%2Frossmax-may-do-huyet-ap-co-tay-7F010806067C.html%3Futm_source%3Dgoogle%26utm_medium%3Dgoogle_share_nhommua%26utm_campaign%3Dgoogle_share&amp;size=medium&amp;count=true&amp;annotation=&amp;width=70&amp;hl=en-US&amp;jsh=m%3B%2F_%2Fapps-static%2F_%2Fjs%2Fwidget%2F__features__%2Frt%3Dj%2Fver%3D1P3lGtDGQkU.vi.%2Fsv%3D1%2Fam%3D!C0fEz9_x4jKIpDHgug%2Fd%3D1%2F#id=I1_1322455682388&amp;parent=http%3A%2F%2Fwww.nhommua.com&amp;rpctoken=763139651&amp;_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe" name="I1_1322455682388" marginwidth="0" marginheight="0" id="I1_1322455682388" hspace="0" allowtransparency="true"></iframe>
                        </div>
                    </div>
                    <div style="float:left;margin:0;" class="zing">
                        <a style="background:none;margin:0;padding-left:0px;margin-right:5px;display:block" name="Rossmax Máy Đo Huyết Áp Cổ Tay" href="http://link.apps.zing.vn/share?url=http%3a%2f%2fwww.nhommua.com%2ftp-ho-chi-minh%2fdeals%2frossmax-may-do-huyet-ap-co-tay-7F010806067C.html%3futm_source%3dzing%26utm_medium%3dzing_share_nhommua%26utm_campaign%3dzing_share&amp;Rossmax+M%c3%a1y+%c4%90o+Huy%e1%ba%bft+%c3%81p+C%e1%bb%95+Tay"></a>
                    </div>
                    <div style="width:130px;float:left;text-align:left;margin-left:10px;overflow:visible;_overflow:hidden;margin-top:6px;" class="like"><fb:like href="http%3a%2f%2fwww.nhommua.com%2ftp-ho-chi-minh%2fdeals%2frossmax-may-do-huyet-ap-co-tay-7F010806067C.html%3futm_source%3dfacebook%26utm_medium%3dfacebook_share_nhommua%26utm_campaign%3dfacebook_share" send="true" layout="button_count" width="125" class=" fb_edge_widget_with_comment fb_iframe_widget"><span><iframe scrolling="no" id="f8b5c31561eb84" name="f2fcf1006f52d66" style="border: medium none; overflow: hidden; height: 20px; width: 150px;" title="Like this content on Facebook." class="fb_ltr" src="http://www.facebook.com/plugins/like.php?channel_url=https%3A%2F%2Fs-static.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%3Fversion%3D3%23cb%3Df8473c3066816%26origin%3Dhttp%253A%252F%252Fwww.nhommua.com%252Ff39dbfdad6797d2%26relation%3Dparent.parent%26transport%3Dpostmessage&amp;extended_social_context=false&amp;href=http%253a%252f%252fwww.nhommua.com%252ftp-ho-chi-minh%252fdeals%252frossmax-may-do-huyet-ap-co-tay-7F010806067C.html%253futm_source%253dfacebook%2526utm_medium%253dfacebook_share_nhommua%2526utm_campaign%253dfacebook_share&amp;layout=button_count&amp;locale=en_US&amp;node_type=link&amp;sdk=joey&amp;send=true&amp;show_faces=false&amp;width=150"></iframe></span></fb:like>
                        <div class=" fb_reset" style="float:right" id="fb-root"><script async="" src="http://connect.facebook.net/en_US/all.js"></script>
                        </div>
                    </div>
                    <div style="clear:both;height:0px;"></div>

                </div>-->

            </div>

            <div class="detail-deal-photo">
            	<div id="divIMG">
            		<{foreach from=$this->explodePicture($grouponEntity->picture) item=pic1 name='pic1'}>
            			
            		<a style="position: absolute;" id="aimgIndexBig<{$smarty.foreach.pic1.index + 1}>" class="photo" name="" href="javascript:void(0)"> 
            		  <img width="478" height="295" id="imgShow<{$smarty.foreach.pic1.index + 1}>" title="<{$grouponEntity->groupon_name}>" alt="<{$grouponEntity->groupon_name}>" src="<{$pic1}>" itemprop="image"> 
            		    <span class="title"><em><{$grouponEntity->groupon_name}></em></span>
            		    <span style="display:none" class="zoom-photo"><em>Xem ảnh lớn</em></span> 
            		 </a>
            		 
            		 <{/foreach}>
            		   
            	</div>
            	<div id="div_MainLIMG" class="photo-slide" style="display: block;">
            	<span id="btnPreIMG" class="btn-prev" style="display: block;"></span>
            	<ul id="div_IMGList" class="photo-slide-inner">
            		
            	</ul>
            	<span id="btnNextIMG" class="btn-next" style="display: block;"></span></div>  </div>
        </div>
        <div class="clear"></div>
        <div class="bg-deal-condi">
            <em class="line"></em>
            <div class="detail-deal-condi">
                <div class="condi-deal-col">
                    <p style="color:#0099ff" class="title">Điểm Nổi Bật</p>
                    <div id="highlights-deal">
                        <{$grouponEntity->hightlight}>
                    </div>
                </div>
                <div class="condi-deal-col">
                    <p style="color:#0099ff" class="title">Điều Kiện</p>
                    <div id="condi-deal">
                        <{$dealsEntity->fine_print}>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--end TN 11.10-->

    <!--bai PR-->
    <div class="detail-deal bg-detail-deal">
        <div itemtype="http://data-vocabulary.org/Review" itemscope="" class="detail-deal-map" id="dListCompanyInfo">
            <h3 itemprop="name"><{$grouponEntity->groupon_name}></h3>
            <em itemprop="reviewer"><a target="_blank" href="http://"></a></em>
            <br>
            <em class="line"></em>
            <ul class="points">
            <{foreach from=$listAddress item=item name='address'}>
				<li itemtype="" itemscope="">
                    <a target="_blank" class="icon" name="" href=""><em><{math equation = "index + 1" index = $smarty.foreach.address.index }></em></a>
                    <p itemtype="" itemscope="" itemprop="address">
                        <span itemprop="tel"><{$item.address}><br>P. <{$item.ward_name}>, Q. <{$item.city_name}></span>
                    </p>
                    <span itemprop="tel">Điện thoại: <{$item.phone}></span>
                    <a target="_blank" itemprop="url" name="" href="http://maps.google.com/maps?daddr=<{$item.address}> , <{$item.city_name}>, Việt Nam">Đến điểm này</a>
                </li>
			<{/foreach}>

            </ul>
        </div>

        <div class="detail-deal-desc" id="dGioiThieu">
        	<{$grouponEntity->description}>
            <div class="social-media">
            	<span class="social-media-left">Xem <a name="" href="<{$APPLICATION_URL}>/Browse/DealComment/Index/city/<{$city}>/id/<{$dealsEntity->id}>">Bình luận</a></span>
            	<div style="overflow:visible;padding-left:5px;" id="divLinkSharing" class="fullview-links">
            	</div>
    		</div>
    	</div>
</div>
    <!--end bai PR-->

    <!--div map-->
    <div style="padding-top:45px;float:left" class="detail-deal">
        <div class="div-map" style="overflow:hidden;width:605px;margin-left:30px;position:relative" id="dMap">
        </div>
    </div>
    <!--end div map-->


    <!--comments-->

    <!--end comments-->


    <!--buy bottom-->

    <div style="float:left" class="detail-deal" id="dBuyBottom">

        <div class="box-white-info horizon">
            <p><{$dealsEntity->sale_price|number_format}><strong> VNĐ</strong></p>
            <p class="orderdeal">
                <a class="view-button" name="" href="<{$APPLICATION_URL}>/Browse/Deals/BuyDeal/city/<{$city}>/id/<{$dealsEntity->id}>"></a>
            </p>
            <div class="box-white-info-sale">
                <div class="box-white-info-save">
                    <span class="number"><{$perDiscount}>%</span>
                    <span>tiết kiệm</span>
                </div>
                <div class="box-white-info-buyer">
                    <span class="number"><{$dealsEntity->bought_count}></span>
                    <span>người mua</span>
                </div>
                <div class="box-white-info-time">
                    <span id="Time_CountDown_0" class="number"></span><span>thời gian còn lại</span>
                </div>
                <div class="clear"></div>

            </div>

        </div>

    </div>
    <!--end comments-->
    <!--chay hang-->

    <!--end comments-->
    <!--het han-->



    <!--end buy bottom-->
</div>

<script type="text/javascript">
//<![CDATA[

var strPhotos={"dsPhoto":[
<{foreach from=$this->explodePicture($grouponEntity->picture) item=pic name='pic'}>
                          {"idphoto":"<{$smarty.foreach.pic.index + 1}>","idsp":"<{$smarty.foreach.pic.index + 1}>","link":"<{$pic}>","title":"<{$grouponEntity->groupon_name}>"},
<{/foreach}>
]};

var TGBatDau='11/30/2011 10:00:00 AM';  dateStartZoomphoto = '12/30/2011 10:00:00 AM';

//]]>
</script>
<script type="text/javascript">
                                   CountBack("Time_CountDown_1962", "<{$duration}>");
                                 /*
                            Author:		Robert Hashemian (http://www.hashemian.com/)
                            Modified by:	Munsifali Rashid (http://www.munit.co.uk/)
                            Modified by:	Tilesh Khatri
                                 */

                                function StartCountDown(myDiv,myTargetDate)
                                {
                                    var dthen	= new Date(myTargetDate);
                                    var dnow	= new Date();
                                    ddiff		= new Date(dthen-dnow);
                                    gsecs		= Math.floor(ddiff.valueOf()/1000);
                                    CountBack(myDiv,gsecs);
                                }

                                function Calcage(secs, num1, num2)
                                {
                                    s = ((Math.floor(secs/num1))%num2).toString();
                                    if (s.length < 2)
                                    {
                                        s = "0" + s;
                                    }
                                    return (s);
                                }

                                function CountBack(myDiv, secs)
                                {
                                    var DisplayStr;
                                    var DisplayFormat = "%%D%% ngày %%H%%:%%M%%:%%S%%";
                                    //var DisplayFormat = "%%H%%:%%M%%:%%S%%";
                                    DisplayStr = DisplayFormat.replace(/%%D%%/g,	Calcage(secs,86400,100000));
                                    DisplayStr = DisplayStr.replace(/%%H%%/g,		Calcage(secs,3600,24));
                                    DisplayStr = DisplayStr.replace(/%%M%%/g,		Calcage(secs,60,60));
                                    DisplayStr = DisplayStr.replace(/%%S%%/g,		Calcage(secs,1,60));
                                    if(secs > 0)
                                    {
                                        document.getElementById(myDiv).innerHTML = DisplayStr;
                                        document.getElementById('Time_CountDown_0').innerHTML = DisplayStr;
                                        setTimeout("CountBack('" + myDiv + "'," + (secs-1) + ");", 990);
                                    }
                                    else
                                    {
                                        if($('#isReloadPage').get('value')=='0'){
                                            window.location.reload();
                                        }
                                        $('#deal .theend_deal').setStyle('display','block');
                                    }
                                }
                                     
                                </script>
                                
